package com.ifengchao.util.http;

import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.core.io.support.PropertiesLoaderUtils;

public class ConfigUtil {
	public ConfigUtil(){}
	private static Properties props = new Properties(); 
	static{
		try {
			props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("config/config.properties"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public static String getValue(String key){
		return props.getProperty(key);
	}

    public static void updateProperties(String key,String value) {    
            props.setProperty(key, value); 
    } 
    
    private static final Log logger = LogFactory.getLog(ConfigUtil.class);
    
	public static String tpInterfacePath = "";//ThirdParty连接配置
	static{
		try {
			Properties  props=PropertiesLoaderUtils.loadAllProperties("config/config.properties");		
			tpInterfacePath=props.getProperty("tpInterfacePath");
		} catch (Exception e) {
			e.printStackTrace();
			logger.error(" 读取配置文件config.properties失败");
		}
	}

}
